<?php
$calc = "volume";
$artifact_type = "C";
$artifact_id = "1"; 
$artifact_name = "Volume Calculator"; 
include_once("./calc/calc_section_header.php");
?>
<p align="left">This calculator will give you an approximate idea about your tank capacity. It can calculate for several popular shapes of aquariums. Optionally you can also use it to find out the approximate volume of your aquarium used up by substrate and how much space is available for water. In addition, if you choose to find out substrate volume, 
the calculator will also approximate the amount of substrate to buy for some popular substrate materials. 
<br>
<div class="center-holder">
<form name="calc-form" action="<?php echo $config_file['web_root']?>/php/calc/calc_server.php" method="post" onsubmit="document.getElementById('form-msg').innerHTML='';AjaxFormPost.send(this,calculatorPostCallback); return false;">
	<input type="hidden" name="func" id="func">
	<table align="center" width="80%" style="min-width: 420px" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td width="180px">
				<a id="tank-pic-link" href="#" rel="lytebox[calc]" title="">
					<img id="tank-pic" class="zoomable" width="180px" src="../images/empty.png" border="0">
				</a>
			</td>
			<td style="min-width: 240px" valign="top" >
				<table class="form-table" align="center" border="0" cellspacing="1" cellpadding="0">
					<tr>
						<td valign="top" ><span class="form-field">Select Tank Type:</span></td>
						<td valign="top">
							<select name="tank-type" id="tank-type" onchange="showTank(this)" onkeyup="showTank(this)">
								<option value="">Select</option>
								<option value="BO">Bowfront</option>
								<option value="CI">Circular</option>
								<option value="CO">Concave</option>
								<option value="HE">Hexagonal</option>
								<option value="OC">Octagonal</option>
								<option value="RE">Rectangular</option>
								<option value="SC">Semi Circular</option>
							</select>
						</td>
					</tr>
					<tr>
						<td valign="top" ><span class="form-field">Dimension Unit [Required]</span></td>
						<td valign="top">
							<select name="vol-dim-units" id="vol-dim-units">
								<option value="">Select</option>
								<?php
									foreach ($dimension_units as $key => $value) {
								?>
								<option value="<?php echo $key?>"><?php echo $value?></option>
								<?php
									}
								?>
							</select>
						</td>
					</tr>
					<tr>
						<td valign="top"><span id="tank-length-label" class="form-field"></span></td>
						<td valign="top"><input type="text" class="textbox" size="8" maxlength="8" name="L" id="L">&nbsp;<img src="../images/help.png" id="tank-length-help" border="0" class="clickable" title="Select tank type to see help"></td>
					</tr>
					<tr>
						<td valign="top"><span class="form-field">Outer Height (H):[Required]</span></td>
						<td valign="top"><input type="text" class="textbox" size="8" maxlength="8" name="H" id="H">&nbsp;<img src="../images/help.png" border="0" class="clickable" title="Refer to 'H' on diagram. If you plan to have the water line lower than the tank brim enter the water column height instead."></td>
					</tr>
					<tr>
						<td valign="top"><span id="tank-width-label" class="form-field">Outer Width (W):</span></td>
						<td valign="top"><input type="text" class="textbox" size="8" maxlength="8" name="W" id="W" disabled="true">&nbsp;<img src="../images/help.png" border="0" class="clickable" title="Refer to 'W' on diagram"></td>
					</tr>
					<tr>
						<td valign="top"><span id="tank-cwidth-label" class="form-field">Center Width (Wc):</span></td>
						<td valign="top"><input type="text" class="textbox" size="8" maxlength="8" name="Wc" id="Wc" disabled="true">&nbsp;<img src="../images/help.png" border="0" class="clickable" title="Refer to 'Wc' on diagram"></td>
					</tr>
					<tr>
						<td valign="top"><span class="form-field">Glass Thickness:[Required]</span></td>
						<td valign="top"><input type="text" class="textbox" size="8" maxlength="8" name="T" id="T"></td>
					</tr>
					<tr>
						<td valign="top"><span class="form-field">Average Substrate Depth:[Optional]</span></td>
						<td valign="top"><input type="text" class="textbox" size="8" maxlength="8" name="Hs" id="Hs">&nbsp;<img src="../images/help.png" border="0" class="clickable" title="Substrate volume will be calculated if this is entered. Measure from outside bottom of tank. If it is sloped you can enter average of max and min depths."></td>
					</tr>
					<tr><td valign="top"><span class="form-field"><input type="submit" id="submit-button" class="active" name="submit" onclick="setCalcFunction('V');inactivate(this)" value="Go"/></span></td></tr>
				</table>
			</td>
		</tr>
	</table>
</form>
</div>
<div class="page-spanner">&nbsp;</div>
<table id="vol-calc-results" width="80%" align="center" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<?php
			$i = 0;
			foreach ($volume_units as $key => $value) {
				$i = $i + 1;
				echo "<td class='table-header";
				if ($i == 1)  echo " table-header-leftmost";
				echo "' align='center'><strong>" . $value . "</strong></td>";
			}
		?>
	</tr>
	<tr><td class="table-sub-header table-sub-header-leftmost" colspan="10"><strong>Total Volume</strong></td></tr>
	<tr>
		<?php
			$i = 0;
			foreach ($volume_units as $key => $value) {
				$i = $i + 1;
				echo "<td id='tank-vol-" . $key . "' class='table-body";
				if ($i == 1)  echo " table-body-leftmost";
				echo "' align='right'>&nbsp;</td>";
			}
		?>
	</tr>
	<tr><td class="table-sub-header table-sub-header-leftmost" colspan="10"><strong>Substrate Volume</strong></td></tr>
	<tr>
		<?php
			$i = 0;
			foreach ($volume_units as $key => $value) {
				$i = $i + 1;
				echo "<td id='substrate-vol-" . $key . "' class='table-body";
				if ($i == 1)  echo " table-body-leftmost";
				echo "' align='right'>&nbsp;</td>";
			}
		?>
	</tr>
	<tr id="substrate-quantity">
		<td  id="substrate-quantity-results" class="table-body table-body-leftmost" colspan="10">&nbsp;</td>
	</tr>
	<tr><td class="table-sub-header table-sub-header-leftmost" colspan="10"><strong>Water Volume (Copy to pending)</strong></td></tr>
	<tr>
		<?php
			$i = 0;
			foreach ($volume_units as $key => $value) {
				$i = $i + 1;
				echo "<td id='water-vol-" . $key . "' class='table-body";
				if ($i == 1)  echo " table-body-leftmost";
				echo "' align='right'>&nbsp;</td>";
			}
		?>
	</tr>
</table>
